package SkipList;

public class Main {
    public static void main(String[] args) {
        SkipList skipList = new SkipList();

        // 插入元素
        skipList.insert("Value 3", 3.00);
        skipList.insert("Value 6", 6.00);
        skipList.insert("Value 7", 7.00);
        skipList.insert("Value 9", 9.00);
        skipList.insert("Value 5", 5.00);

        // 获取SkipList中全部元素
        SkipListNode[] allData = skipList.getAllData();
        for (SkipListNode node : allData) {
            System.out.println("Node value: " + node.getValue() + ", Node score: " + node.getScore());
        }

        // 逆向获取SkipList中全部元素
        SkipListNode[] allDataReverse = skipList.getAllDataReverse();
        for (SkipListNode node : allDataReverse) {
            System.out.println("Node value: " + node.getValue() + ", Node score: " + node.getScore());
        }

        // 查找元素
        SkipListNode node = skipList.find(7);
        System.out.println("Found node with score 7: " + node.getValue());
    }
}

